<template>
  <div>
    <el-table :data="studentList" style="width: 100%" border stripe>
      <el-table-column fixed prop="id" label="编号"/>
      <el-table-column prop="name" label="名字"/>
      <el-table-column prop="birthday" label="生日"/>
      <el-table-column prop="sex" label="性别"/>
      <el-table-column prop="sex" label="操作">
        <template #default = scope>
          <el-button type="text" @click="open">退货</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      studentList: [{id: 1, name: "小王", birthday: "2001-01-01", sex: "男"},
        {id: 2, name: "小李", birthday: "2002-01-04", sex: "男"},
        {id: 3, name: "小力", birthday: "2003-01-05", sex: "男"},
        {id: 4, name: "小张", birthday: "2004-01-06", sex: "男"},]
    }
  },
  methods:{
    open() {
      this.$confirm('确认退货吗', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '成功提交申请!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消提交申请'
        });
      });
    }
  }
}
</script>

<style scoped>

</style>